//
//  InformIdentityCell.m
//  diaoyuren
//
//  Created by 钓鱼人 on 16/4/11.
//  Copyright © 2016年 game. All rights reserved.
//

#import "InformIdentityCell.h"

@interface InformIdentityCell ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *linHeight;

@end

@implementation InformIdentityCell

- (void)awakeFromNib {
    self.selectionStyle = 0;
    self.linHeight.constant = 0.5;
    
    self.titile.font = font(SCREEN_WIDTH*0.045);
    
    self.personSelect.titleLabel.font = font(SCREEN_WIDTH*0.035);
    self.bossSelect.titleLabel.font = self.personSelect.titleLabel.font;
    self.text = [[UITextField alloc]init];
}

-(void)setIsYuJuDian:(BOOL)isYuJuDian{

    _isYuJuDian = isYuJuDian;
    if (_isYuJuDian) {
        [self.bossSelect setTitle:@"渔具店老板" forState:UIControlStateNormal];
    }
}

-(void)setIdentity:(NSString *)identity{
    _identity = identity;
    self.text.text = _identity;
    if (_identity.integerValue==1) {//钓场老板
        self.bossSelect.selected = YES;
        self.personSelect.selected =NO;
        
    }else if (_identity.integerValue==2){
        self.bossSelect.selected = NO;
        self.personSelect.selected =YES;
    
    }else{
    
        self.bossSelect.selected = NO;
        self.personSelect.selected =NO;
    }

}
- (IBAction)personAction:(UIButton *)sender {
    
    self.bossSelect.selected = NO;
    sender.selected = !sender.selected;
    self.text.text = @"2";
    
}
- (IBAction)BossAction:(UIButton *)sender {
    
    self.personSelect.selected = NO;
    sender.selected = !sender.selected;
    
    self.text.text = @"1";
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
